package com.feelingj.thread.t1;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class DemoService {
	
	@Async
	public void a() throws InterruptedException {
		while (true) {
			System.out.println("a");
			Thread.sleep(2000);
		}
	}
	
	@Async
	public void b() {
		while (true) {
			System.out.println("b");
			try {
				Thread.sleep(2000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}

}
